<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.jd.ty.pojo" >
	<class name="Position" table="COMPANY_POSITION" schema="TYMS">
	    <id name="positionId" type="java.lang.Long">
			<column name="POSITION_ID" precision="10" scale="0" />
			<generator class="native" />
		</id>
		<property name="positionName" type="java.lang.String">
			<column name="POSITION_NAME" length="50" not-null="true" />
		</property>
		<many-to-one name="parent" class="Position"
			column="PARENT_ID" cascade="save-update" />
		<bag name="children" cascade="all" inverse="true"
			lazy="false">
			<key column="PARENT_ID" />
			<one-to-many class="Position" />
		</bag>

		<many-to-one name="department" class="Dictionary" fetch="select"
			lazy="false">
			<column name="DEPARTMENT_ID" precision="10" scale="0" />
		</many-to-one>
	</class>
</hibernate-mapping>
